import SvgIcon from '@/components/SvgIcon/index.vue';
import { App, Component } from 'vue';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

const allGlobalComponents: Component = { SvgIcon };
// 对外暴露插件对象
export default {
  // 务必叫install方法
  install(app: App) {
    Object.entries(ElementPlusIconsVue).forEach(([key, component]) => {
      app.component(key, component);
    });
    Object.keys(allGlobalComponents).forEach((key) => {
      app.component(key, allGlobalComponents[key]);
    });
  },
};
